package com.yiqi.lottery.feature.documentary.view.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import butterknife.BindView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yiqi.lottery.R;
import com.yiqi.lottery.common.util.DateTool;
import com.yiqi.lottery.entity.bo.HallUserBo;

public class PersonalLotteryAdapter extends BaseQuickAdapter<HallUserBo.ListBean, BaseViewHolder> {

    public PersonalLotteryAdapter() {
        super(R.layout.item_documentary_person);
    }

    @Override
    protected void convert(BaseViewHolder helper, HallUserBo.ListBean item) {

        helper.setText(R.id.tv_personal_content, "")
                .setText(R.id.tv_personal_zigou, item.getOrder_amount()+"")
                .setText(R.id.tv_personal_qigou, "" + item.getLast_fee())
                .setText(R.id.tv_personal_content, item.getFollow_follow_intro())
                .setText(R.id.tv_personal_renshu, item.getFollow_num() + "")
                .setText(R.id.tv_personal_finish_date, "截止日期：" + DateTool.TimeStamp2Date(item.getFinish_time()))
                .setVisible(R.id.btn_documentary_again, item.getFollow_status() == 0 ? true : false)
                .addOnClickListener(R.id.btn_documentary_again);
        ImageView imageView = helper.getView(R.id.iv_show_jiang);

        //0:可跟单，1:待开奖 2:未中奖 3:中奖
        if (item.getFollow_status() == 0) {
            imageView.setVisibility(View.GONE);
        } else if (item.getFollow_status() == 1) {
            imageView.setImageResource(R.drawable.ic_daikaijiang);
        } else if (item.getFollow_status() == 2) {
            imageView.setImageResource(R.drawable.image_wzj);
        } else if (item.getFollow_status() == 3) {
            imageView.setImageResource(R.drawable.image_yzj);
        }
    }
}
